package com.woniuxy.cloud.api;

import com.woniuxy.cloud.api.dto.LoginDto;
import com.woniuxy.cloud.api.dto.RoleDto;
import com.woniuxy.cloud.api.dto.UserDto;
import com.woniuxy.cloud.api.param.DepositLevelParam;
import com.woniuxy.cloud.api.param.RoleIdAndAreaParam;
import com.woniuxy.cloud.demo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


import java.util.List;

/**
 * @author 周川雄
 * @date 2022/1/26 22:59
 */
@FeignClient(value = "user", path = "user")
public interface UserQueryAPI {
    @PostMapping("login")
    LoginDto login(@RequestParam("username") String username);


    @PostMapping("findUserById")
    UserDto findUserById(@RequestParam("userId") Integer userId);


    @PostMapping("updateUserDepositLevel")
    UserDto updateUserDepositLevel(@RequestBody DepositLevelParam param);


    @PostMapping("listUserByRoleIdAndArea")
    Result<List<UserDto>> listUserByRoleIdAndArea(@RequestBody RoleIdAndAreaParam param);

    @PostMapping("findRoleByUserId")
    Result<List<RoleDto>> findRoleByUserId(@RequestParam("userId") Integer userId);

    @PostMapping("selectResourceByUserId")
    List<String> selectResourceByUserId(@RequestParam("id") Integer id);
}
